package com.ken.app.enums;

/**
 * Author: Liuk
 * Mail: leo_work@aliyun.com
 * Date: 2017/8/15 0015
 * Desc: 接口返回状态码
 */
public enum ResultCode {

    success(200, "表明 API 的请求正常"),
    invalid_request_scheme(100, "invalid_request_scheme 错误的请求协议"),
    invalid_request_method(101, "invalid_request_method 错误的请求方法"),
    access_token_is_missing(102, "access_token_is_missing 未找到 access_token"),
    invalid_access_token(103, "invalid_access_token access_token 不存在或已被用户删除，或者用户修改了密码"),
    invalid_apikey(104, "invalid_apikey apikey 不存在或已删除"),
    apikey_is_blocked(105, "apikey_is_blocked apikey 已被禁用"),
    access_token_has_expired(106, "access_token_has_expired access_token 已过期"),
    invalid_request_uri(107, "invalid_request_uri 请求地址未注册"),
    invalid_credencial1(108, "invalid_credencial1 用户未授权访问此数据"),
    invalid_credencial2(109, "invalid_credencial2 apikey 未申请此权限"),
    not_trial_user(110, "not_trial_user 未注册的测试用户"),
    rate_limit_exceeded1(111, "rate_limit_exceeded1 用户访问速度限制"),
    rate_limit_exceeded2(112, "rate_limit_exceeded2 IP 访问速度限制"),
    required_parameter_is_missing(113, "required_parameter_is_missing 缺少参数"),
    unsupported_grant_type(114, "unsupported_grant_type 错误的 grant_type"),
    unsupported_response_type(115, "unsupported_response_type 错误的 response_type"),
    client_secret_mismatch(116, "client_secret_mismatch client_secret不匹配"),
    redirect_uri_mismatch(117, "redirect_uri_mismatch redirect_uri不匹配"),
    invalid_authorization_code(118, "invalid_authorization_code authorization_code 不存在或已过期"),
    invalid_refresh_token(119, "invalid_refresh_token refresh_token 不存在或已过期"),
    username_password_mismatch(120, "username_password_mismatch 用户名密码不匹配"),
    invalid_user(121, "invalid_user 用户不存在或已删除"),
    user_has_blocked(122, "user_has_blocked 用户已被屏蔽"),
    access_token_has_expired_since_password_changed(123, "access_token_has_expired_since_password_changed 因用户修改密码而导致 access_token 过期"),
    access_token_has_not_expired(124, "access_token_has_not_expired access_token 未过期"),
    invalid_request_scope(125, "invalid_request_scope 访问的 scope 不合法，开发者不用太关注，一般不会出现该错误"),
    invalid_request_source(126, "invalid_request_source 访问来源不合法"),
    thirdparty_login_auth_faied(127, "thirdparty_login_auth_faied 第三方授权错误"),
    user_locked(128, "user_locked 用户被锁定"),
    unknown(999, "unknown 未知错误");

    private Integer code;
    private String msg;

    ResultCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
